package com.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;

import com.beans.Scenic;
import com.mapper.ScenicMapper;

@Controller
public class ScenicController {
	
	@Resource
	private ScenicMapper scenicmapper;
	


	@GetMapping("scenic-all.html")
	public String sceniclist(ModelMap m) {
     List<Scenic> list = scenicmapper.selectAll();
    	m.put("list", list);	
    	m.addAttribute("msg","共有 " +selectsum()+" 条数据");
		return "scenic-all.html"; 
	}
 int selectsum() {
   	 return scenicmapper.selectscenicSum();
    }
 

}
